package cn.bandeqing.order.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

@Data
public class OrderDetailResp implements Serializable {

    @Schema(description = "订单ID")
    private Long orderId;

    @Schema(description = "客户名称")
    private String customerName;

    @Schema(description = "客户电话")
    private String customerPhone;

    @Schema(description = "服务时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp serviceTime;

    @Schema(description = "起点")
    private String startAddress;

    private Double startAddressLng;

    private Double startAddressLat;

    private Integer orderStatus;

    @Schema(description = "新家")
    private String newAddress;

    private Double newAddressLng;

    private Double newAddressLat;

    @Schema(description = "距离km")
    private Double distance;

    private Long storeId;

    @Schema(description = "门店")
    private String storeName;

    /**
     * 套餐总价
     */
    @Schema(description = "增值服务价格")
    private Double productTotalPrice;

    /**
     * 优惠金额
     */
    @Schema(description = "优惠金额")
    private Double discountsPrice;

    @Schema(description = "其他费用")
    private Double otherPrice;

    /**
     * 总价
     */
    @Schema(description = "总价")
    private Double totalPrice;

    // 支付状态 支付金额
    @Schema(description = "支付状态 0=无需支付 1=支付定金 2=支付尾款")
    private Integer payStatus = 0;

    @Schema(description = "支付金额")
    private Double payMoney;

    /**
     * 应付定金
     */
    @Schema(description = "应付定金")
    private Double shouldDeposit;

    // 实付定金
    @Schema(description = "实付定金")
    private Double payDeposit;

    // 实付尾款
    @Schema(description = "实付尾款")
    private Double payFinalPayment;

    // 套餐信息
    private Long productId;
    @Schema(description = "套餐")
    private String productName;

    private Long productTypeId;
    private String productTypeName;
    private Boolean moveHouse;

    private String productMainImg;

    // 城市编码6位国家行政
    private String cityCode;
    @Schema(description = "城市")
    private String cityName;

    @Schema(description = "起点楼层")
    private Integer startFloor;
    @Schema(description = "起点电梯")
    private Boolean startElevator;
    @Schema(description = "起点楼层费")
    private Double startFloorPrice;

    private Integer newFloor;
    private Boolean newElevator;
    private Double newFloorPrice;

    @Schema(description = "公里费")
    private Double kmPrice;

    private String customerRemark;
    private String serviceRemark;
    private String orderRemark;

    private List<ProductDetail> productDetails;
    private String productDetailsStr;

    @Data
    public static class ProductDetail implements Serializable {

        private Long productInventoryRecordId;

        private Long inventoryId;

        /**
         * 规格ID
         */
        private Long productSpecificationId;

        private String productSpecification;

        private Long productId;

        private String productName;

        private Double productPrice;

        private Double productTotalPrice;

        /**
         * 店铺ID
         */
        private Long storeId;

        private String storeName;

        private Integer afterInventory;

        /**
         * 库存
         */
        private Integer changeInventory;

        private Integer beforeInventory;

        private Long orderId;

        private String remark;

    }

}
